def socket = "228.5.6.7"
def port = 1000
def hopCount = 0

try{
	def msg = "Groovy Rocks from gsrv"
	InetAddress group = InetAddress.getByName(socket)
	s = new MulticastSocket(port)
	s.setTimeToLive(hopCount)
	s.joinGroup(group)
	
	DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(),
                             group, 1000);


	10.times{
 		s.send(hi)	
	}

	s.close()	
}
catch(Exception e)
{
	println e
}
